package com.aglhz.nature.fragment;







import com.aglhz.nature.R;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class ServiceFragment extends Fragment {
	private WebView ser_webView;
	private String url;
	@Override
	public View onCreateView(LayoutInflater inflater,
			 ViewGroup container,  Bundle savedInstanceState) {

		View view = inflater.inflate(R.layout.servicefragment, null);
		ser_webView=(WebView) view.findViewById(R.id.ser_webView);
		
		WebSettings webSettings = ser_webView.getSettings();  
	    //设置WebView属性，能够执行Javascript脚本    
	    webSettings.setJavaScriptEnabled(true);    
	    //设置可以访问文件  
	    webSettings.setAllowFileAccess(true);  
	  //webview自适应屏幕
	    webSettings.setUseWideViewPort(true); 
	    webSettings.setLoadWithOverviewMode(true); 
	    url="http://h5.aglhz.com/gc_community/m/serviceAPP.html";
	    ser_webView.loadUrl(url);    
	    //设置Web视图  
	   
	    ser_webView.setWebViewClient(new WebViewClient(){
	        @Override
	        public boolean shouldOverrideUrlLoading(WebView view, String url) {
	            view.loadUrl(url);
	            return true;
	        }
	       
	        @Override
	        public void onPageStarted(WebView view, String url, Bitmap favicon) {
	        	
	        	super.onPageStarted(view, url, favicon);
	     
	        
	    	
	        }
	        
	        @Override
			public void onPageFinished(WebView view, String url) {
				
				super.onPageFinished(view, url);
				

			}
	    });
	 

	

		return view;
	}
}
